package com.secsbrain.development.biz.constant;

import java.util.Arrays;
import java.util.List;

/**
 * 应用类型
 * Created by yangyang.zhang on 2017/6/21.
 */
public enum AppType {
    WEB("tomcat") {
        @Override
        public List<TaskType> releaseProcess() {
            return Arrays.asList(TaskType.PACKAGE, TaskType.DEPLOY);
        }
    }, SERVICE("jar") {
        @Override
        public List<TaskType> releaseProcess() {
            return Arrays.asList(TaskType.PACKAGE, TaskType.DEPLOY);
        }
    }, BOOT("boot") {
        @Override
        public List<TaskType> releaseProcess() {
            return Arrays.asList(TaskType.PACKAGE, TaskType.DEPLOY);
        }
    }, NODEJS("nodejs") {
        @Override
        public List<TaskType> releaseProcess() {
            return Arrays.asList(TaskType.PACKAGE, TaskType.DEPLOY);
        }
    }, STATIC("static") {
        @Override
        public List<TaskType> releaseProcess() {
            return Arrays.asList(TaskType.PACKAGE, TaskType.DEPLOY);
        }
    }, STATIC_GULP("gulp") {
        @Override
        public List<TaskType> releaseProcess() {
            return Arrays.asList(TaskType.PACKAGE, TaskType.DEPLOY);
        }
    }, STATIC_NPM("npm") {
        @Override
        public List<TaskType> releaseProcess() {
            return Arrays.asList(TaskType.PACKAGE, TaskType.DEPLOY);
        }
    }, STATIC_NODE("static_node") {
        @Override
        public List<TaskType> releaseProcess() {
            return Arrays.asList(TaskType.PACKAGE, TaskType.DEPLOY);
        }
    }, PHP("php") {
        @Override
        public List<TaskType> releaseProcess() {
            return Arrays.asList(TaskType.PACKAGE, TaskType.DEPLOY);
        }
    }, DOTNET("dotnet") {
        @Override
        public List<TaskType> releaseProcess() {
            return Arrays.asList(TaskType.PACKAGE, TaskType.DEPLOY);
        }
    };
    private String systemType;

    AppType(String systemType) {
        this.systemType = systemType;
    }

    public String getSystemType() {
        return systemType;
    }

    /**
     * 应用类型对应的发布流程
     *
     * @return 流程包括的任务类型, 排序
     */
    public abstract List<TaskType> releaseProcess();
}
